﻿using NUnit.Framework;
using PoliticalClassifier.Support;
using System;

namespace PoliticalClassifier.Domain.Tests
{
    /// <summary>
    /// TestFixture class to test WeightAttribute class functionality.
    /// </summary>
    [TestFixture]
    public class WeightAttributeTest
    {
        [Test]
        public void WeightAttributeAssignmentTest()
        {
            String strName = "AGE";
            Point2D pointWeightValue = new Point2D(12345.6789, 8976.4321);

            IWeightAttribute weightAttribute = new WeightAttribute(strName, pointWeightValue);

            Assert.AreEqual(strName, weightAttribute.Name);
            Assert.AreEqual(pointWeightValue.X, weightAttribute.Value.X);
            Assert.AreEqual(pointWeightValue.Y, weightAttribute.Value.Y);

            pointWeightValue = new Point2D(8080, 1010);
            weightAttribute.Value = pointWeightValue;
            Assert.AreEqual(pointWeightValue.X, weightAttribute.Value.X);
            Assert.AreEqual(pointWeightValue.Y, weightAttribute.Value.Y);
        }
    }
}
